package view.panel.item
{
	import flash.display.Bitmap;
	import flash.text.TextField;
	
	import utils.ColorTool;
	import utils.TextTool;
	
	import view.components.RemoteImage;
	
	public class ItemImg extends RemoteImage
	{
		private var countText:TextField;
		
		public function ItemImg(imgWidth:int, imgHeight:int)
		{
			super(imgWidth, imgHeight, null,false);
			initCount();
		}
		
		private function initCount():void
		{
			countText = TextTool.getTextField(dWidth,20,12,0xFFFFFF,false,false,"right");
			countText.y = dHeight - countText.height;
			ColorTool.glowRing(countText);
			addChild(countText);
		}
		
		public function updateCount(v:String):void
		{
			countText.text = v;
		}
		
		public function get count():int
		{
			return int(countText.text);
		}
		
		override protected function loadComplete(content:Bitmap):void
		{
			super.loadComplete(content);
			addChild(countText);
		}
		
		
		override public function destroy() : void
		{
			super.destroy();
			countText = null;
		}
		
		
	}
}